﻿using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;

namespace GoogleApi
{
    [DataContract]
    public class Predictions : IEnumerable<Prediction>
    {
        private ObservableCollection<Prediction> _predictions;

        [DataMember]
        public ObservableCollection<Prediction> predictions
        {
            get { return _predictions ?? new ObservableCollection<Prediction>(); }
            set { _predictions = value; }
        }

        [DataMember]
        public string status { get; set; }

        public IEnumerator<Prediction> GetEnumerator()
        {
            return ((IEnumerable<Prediction>) predictions).GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }
}